<%@ page pageEncoding="utf-8" import="java.util.*" %>
<%@ page import="DoMain.Procurement" %>
<%@ page import="Dao.CriteriaProcurement" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@page import="java.text.SimpleDateFormat"%>
<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

    <title>菜品管理</title>
    <script type="text/javascript" src="script/jquery-3.3.1.js"></script>
    <script type="text/javascript">

		$(function(){
			
			$(".delete").click(function(){
				
				var content=$(this).parent().parent().find("td:eq(1)").text();
				var flag=confirm("确定要修改"+content+"的状态吗？");
				
				return flag;
				
			});	
		});
		
</script>
  </head>
  <body>
  <a href="CheckPage.Do?currentPage=1">查看审核单</a><br>

 
  
  <% 	List<Procurement> procurements=(List<Procurement>)request.getAttribute("procurements"); %>
  
  <table class="table table-hover">

    <tr class="table-primary" align="center">
      <th scope="col" align="center">采购单号</th>
      <th scope="col" align="center">采购人</th>
      <th scope="col" align="center">采购材料</th>
      <th scope="col" align="center">采购时间</th>
      <th scope="col" align="center">采购单价</th>
      <th scope="col" align="center">状态</th>
      <th scope="col" align="center">操作</th>
    </tr>
<%
		Date d = new Date();
		SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String now = df.format(d);
	%>


  <c:forEach items="${procurements}" var="po">
			<tr  class="table-light">
				<td class="table-success" scope="row" align="center">${po.proNo}</td>
				<td class="table-success" scope="row" align="center">${po.proMan}</td>
				<td class="table-warning" scope="row" align="center">${po.proMaterial}</td>
				<td class="table-warning" scope="row" align="center"><%=now %></td>
				<td class="table-warning" scope="row" align="center">${po.proPay}</td>
				<td class="table-warning" scope="row" align="center">${po.status}</td>
				<td><a align="center" class="delete" href="editStatus.Do?proNo=${po.proNo}">修改状态</a></td>
				
			</tr>
			</c:forEach>

	  	</table>
  	<table align="center">
	<tr align="center">
    <td align="center" class="page-item"><a class="page-link" href="CheckPage.Do?currentPage=1">首页</a></td>
    <td align="center" class="page-item"><a class="page-link" href="CheckPage.Do?currentPage=1">1</a></td>
    <td align="center" class="page-item"><a class="page-link" href="CheckPage.Do?currentPage=2">2</a></td>
    <td align="center" class="page-item"><a class="page-link" href="CheckPage.Do?currentPage=3">3</a></td>
    <td align="center" class="page-item"><a class="page-link" href="CheckPage.Do?currentPage=4">4</a></td>
    <td align="center" class="page-item"><a class="page-link" href="CheckPage.Do?currentPage=5">5</a></td>
    <td align="center" class="page-item"><a class="page-link" href="CheckPage.Do?currentPage=13">尾页</a></td>
</tr>
</table>
</body>
  </html>